getSerializable
open fun <T : Serializable?> getSerializable(@NonNull in: Bundle, @Nullable key: String, @NonNull clazz: Class<T>): T(source)
Returns the value associated with the given key or null
if:
- No mapping of the desired type exists for the given key.
- A
null
value is explicitly associated with the key. - The object is not of type
clazz
.
- SDK 34 and above, this method matches platform behavior.
- SDK 33 and below, the object type is checked after deserialization.
Return
a Serializable value, or null
Parameters
in
The bundle to retrieve from.
key
a String, or null
clazz
The type of the object expected